Skip to content

Add WiFi Connectivity Validation with Hybrid nmcli and wpa_supplicant Support #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smuppand
Copy link
Contributor

@smuppand smuppand commented Jun 6, 2025

What Changed

  • The WiFi_Manual_IP connectivity test (run.sh) is fully refactored to call only helper functions from functestlib.sh—no duplicate WPA config or udhcpc logic.
  • Adds a trap so that any temporary modifications to the udhcpc script are always reverted, regardless of test exit path.
  • All credential, WPA config, DHCP, and cleanup logic is delegated to helpers.
  • Logging is improved for debuggability.
  • The script is now fully POSIX sh and ShellCheck compliant.
  • No changes to existing test logic, just a modernization for maintainability and reliability.

Why

  • Makes the test more maintainable, easier to reuse, and less error-prone when multiple tests modify system scripts.
  • Ensures proper cleanup and restores system configuration after testing, even on failure or abort.
  • Consistent use of helper functions enables code reuse across other WiFi/network scripts.

Testing

  • Verified on minimal and full Yocto builds.
  • Clean up, WPA, and DHCP flows validated for both success and failure cases.
  • trap confirmed to revert udhcpc script on all exit paths.
@mwasilew @vnarapar @qcom-anilyada 

@smuppand smuppand requested review from mwasilew and vnarapar June 6, 2025 13:30
@smuppand smuppand force-pushed the wifi-connectivity branch 8 times, most recently from 4ebdf94 to 4533254 Compare June 11, 2025 10:06
@smuppand smuppand force-pushed the wifi-connectivity branch 2 times, most recently from 5872754 to 333283f Compare June 18, 2025 09:00
@smuppand smuppand force-pushed the wifi-connectivity branch from 333283f to 95b052b Compare June 22, 2025 10:41
… and trap-based restore

- Switch WiFi_Manual_IP/run.sh to only use modular helper functions from functestlib.sh.
- Add 'trap' to always restore original udhcpc script on test exit, ensuring testbed is left clean.
- Use wifi_write_wpa_conf for WPA config creation (eliminate code duplication).
- Use ensure_udhcpc_script and restore_udhcpc_script for robust script handling.
- Harden cleanup and error handling (all exits go through helpers).
- Improved logging, POSIX and ShellCheck compliance.
- No change in test semantics or interface.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
@smuppand smuppand force-pushed the wifi-connectivity branch from 95b052b to 6c3bb9d Compare June 23, 2025 16:10
@smuppand smuppand requested a review from ricardosalveti June 23, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants